package cn.edu.scau.cmi.xuzhihao.interProgramming.experiment3.factory;

import cn.edu.scau.cmi.xuzhihao.interProgramming.experiment3.entity.CarBroken;
import cn.edu.scau.cmi.xuzhihao.interProgramming.experiment3.entity.DriverHurt;
import cn.edu.scau.cmi.xuzhihao.interProgramming.experiment3.entity.ManyAccident;
import cn.edu.scau.cmi.xuzhihao.interProgramming.experiment3.entity.PersonHurt;

public class SimpleFactory {
	
	public static Object getInstance(String AccdentName) {
		switch (AccdentName) {
		case "carBroken":
			return new CarBroken();
		case "DriverHurt":
			return new DriverHurt();
		case "ManyAccident":
			return new ManyAccident();
		case "PersonHurt":
			return new PersonHurt();
		default:
			return null;
		}
	}
}
